directive.directive('dialog',[function() {
    return {
        restrict:'E',
        transclude:true,
        replace:true,
        template:'<div class="ui modal" ng-transclude><i class="close icon"></i></div>'
    }
}]);

directive.directive('dialogHeader',[function() {
    return {
        restrict:'E',
        transclude:true,
        replace:true,
        template:'<div class="header" ng-transclude></div>'
    }
}]);

directive.directive('dialogContent',[function() {
    return {
        restrict:'E',
        transclude:true,
        replace:true,
        template:'<div class="content" ng-transclude></div>'
    }
}]);

directive.directive('dialogAction',[function(){
    return {
        restrict:'E',
        transclude:true,
        replace:true,
        template:'<div class="actions" ng-transclude></div>'
    }
}]);

directive.directive('dialogActionCancel',[function(){
    var text={
        cancel:'取消'
    };

    return {
        restrict:'E',
        transclude:true,
        replace:true,
        template:'<button class="ui button cancel tiny" ng-transclude></button>',
        compile:function($element,$attrs){
            if(stringUtil.isBlank($element.html())) {
                $element.html(text.cancel);
            }
        }
    }
}]);

directive.directive('dialogActionOk',[function(){
    var text={
        ok:'确认'
    };

    return {
        restrict:'E',
        transclude:true,
        replace:true,
        template:'<button class="ui button ok green tiny" ng-transclude></button>',
        compile:function($element,$attrs){
            if(stringUtil.isBlank($element.html())) {
                $element.html(text.ok);
            }
        }
    }
}]);